import request from '@/utils/request'

//                                          电源点维护
// 获取自身及下级分公司
export const getTreeListApi = (params) =>
  request.get('/pio-microservice-biz/cbm/organization/manage/list', { params })

// 查询电源点分页
export const getPowerPointPageApi = (params) =>
  request.get('/pio-microservice-biz/pio/ect/powerPoint/page', { params })

// 新增
export const addPowerPointApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/powerPoint/add', data)

// 修改
export const editPowerPointApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/powerPoint/update', data)

// 删除

export const delPowerPointApi = (id) =>
  request.post(`/pio-microservice-biz/pio/ect/powerPoint/delete?id=${id}`)

//                                          线路维护

// 查询左侧电源点树
export const getPointTreeApi = (params) =>
  request.get('/pio-microservice-biz/pio/ect/line/first/tree', { params })

// 查询左侧线路树
export const getLineTreeApi = (params) =>
  request.get('/pio-microservice-biz/pio/ect/line/second/tree', { params })

// 查询线路分页
export const getPowerLinePageApi = (params) =>
  request.get('/pio-microservice-biz/pio/ect/line/page', { params })

// 新增
export const addPowerLineApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/line/add', data)

// 修改
export const editPowerLineApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/line/update', data)

// 删除
export const delPowerLineApi = (id) =>
  request.post(`/pio-microservice-biz/pio/ect/line/delete?id=${id}`)

//                                          企业维护

// 查询企业分页
export const getPowerCustomerPageApi = (params) =>
  request.get('/pio-microservice-biz/pio/ect/company/page', { params })

// 新增
export const addPowerCustomerApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/company/add', data)

// 获取当前登录人单位下级所有用电单位
export const getCompanyListApi = () =>
  request.get('/pio-microservice-biz/pio/common/under/company/list', { isShowAll: '0' })

// 修改
export const editPowerCustomerApi = (data) =>
  request.post('/pio-microservice-biz/pio/ect/company/update', data)

// 删除
export const delPowerCustomerApi = (id) =>
  request.post(`/pio-microservice-biz/pio/ect/company/delete?id=${id}`)